/**
 * uno.config.ts
 * 配置 unocss
 */
import { defineConfig } from 'unocss'
import { presetWind } from '@unocss/preset-wind'
import { presetUno } from '@unocss/preset-uno'
import { presetAttributify } from '@unocss/preset-attributify'
import transformerDirectives from '@unocss/transformer-directives'

export default defineConfig({
  // ...UnoCSS options
  presets: [presetWind(), presetUno(), presetAttributify()],
  transformers: [
    transformerDirectives() // 启用@apply等指令
  ],
  shortcuts: {
    btn: 'bg-blue-500 text-white px-4 py-2 rounded-md',
    'bd-1': 'border-1px border-gray-200 rounded-md border-solid',
    'bd-t': 'border-t-1px border-gray-200 border-solid border-r-0 border-l-0 border-b-0',
    'bd-b': 'border-b-1px border-gray-200 border-solid border-r-0 border-l-0 border-t-0',
    'bd-l': 'border-l-1px border-gray-200 border-solid border-r-0 border-t-0 border-b-0',
    'bd-r': 'border-r-1px border-gray-200 border-solid border-l-0 border-t-0 border-b-0',
    'bd-btn':
      'border-1px border-gray-200 rounded-md border-solid cursor-pointer hover:border-gray-400',
    'text-btn':
      'text-gray-800 px-4 py-2 rounded-full hover:bg-gray-100 flex items-center justify-center gap-2 cursor-pointer'
    // 'font-sm': ''
    // 'bd-1-hover': 'hover:border-blue-500'
  },
  theme: {
    colors: {
      primary: '#0070f3'
    }
  },
  safelist: ['btn', 'iconfont']
})
